/**
 * Makes a ComboBox have a twin trigger that is used to clear the value from the field.
 * User listener 'clear' to do something.
 *
 * @author Michael Giddens & help from Animal
 * http://extjs.com/forum/showthread.php?p=76130
 *
 * @history 2007-10-21 jvs
 * Combobox Mod for Ext 2.0
 */
Ext.ux.TwinComboBox = Ext.extend(Ext.form.DateField, {
		initComponent : Ext.form.TwinTriggerField.prototype.initComponent
	,	afterRender: Ext.form.TwinTriggerField.prototype.afterRender
	,	getTrigger : Ext.form.TwinTriggerField.prototype.getTrigger
	, 	getTriggerWidth: Ext.form.TwinTriggerField.prototype.getTriggerWidth
	,	initTrigger	: Ext.form.TwinTriggerField.prototype.initTrigger
	,	trigger1Class	:	'x-form-clear-trigger'
	,	trigger2Class : 'x-form-date-trigger'	
	,	hideTrigger1: true
	,	hideTrigger2: false
	,	editable: false
	, 	reset: Ext.form.DateField.prototype.reset.createSequence(function(){
			 this.triggers[0].hide();
		})
	, 	onSelect: Ext.form.DateField.prototype.onSelect.createSequence(function(){
			this.triggers[0].show();
		})
	, 	onTrigger2Click: function(){
			this.onTriggerClick();
		}
	, 	onTrigger1Click: function(){
			this.reset();
			this.hideTrigger2 = true;
			this.fireEvent('clear', this);
		}	
});

Ext.reg('xtwincombodate', Ext.ux.TwinComboBox);